<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="../css/element.css" rel="stylesheet"/>
    <link href="../css/styleindex.css" rel="stylesheet"/>
    <style>

    </style>
</head>
<body style="background:#EFF0F4;">

  <div class="mui-content">
    <div id="vm" class="x-examok" v-cloak>
      <div class="x-header-g" id="header">
        <a class="x-header-arrow" @click="closecard"></a>
        <div class="x-header-t">个人档案</div>
      </div>

    </div>
  </div>

  <script type="text/javascript" src="../script/vue.js"></script>
  <script type="text/javascript" src="../script/element.js"></script>
  <script type="text/javascript" src="../script/api.js"></script>
  <script type="text/javascript" src="../script/base.js"></script>
	<script>
apiready = function () {
    var tis = api.pageParam.istype;
    console.log(tis);
    $api.fixStatusBar($api.byId('header'));
    var iostoph = api.safeArea.top+34;
    console.log(iostoph);
    var tfromhtmlname = api.pageParam.fromhtmlname;
    function fnNvnsetSelected(index){
        var NVNavigationBar = api.require('NVNavigationBar');
        NVNavigationBar.setSelected({
            id: 'first',
            index: index,
            selected: true
        }, function(ret) {

        });
    }
    //
    var vm = new Vue({
      el:'#vm',
      data(){
        return{
          tistype:'',
          thfromhtmlname:'',

        }
      },
      created:function() {
        var that=this;


      },
      mounted:function(){
        var that=this;
        that.tistype = tis;
        that.thfromhtmlname = tfromhtmlname;
        // if(that.tistype==1){//在职
        //   that.NVNavigationBar_open(0)
        // }else{//离职
          that.NVNavigationBar_open(0)
        // }

      },
      methods: {
        //
        closecard:function(){
          api.closeFrameGroup({
              name: 'openpersonrecordgroup'
          });
          setTimeout(function(){
            api.closeFrame();
          },500)

        },
        //
        NVNavigationBar_open:function(frameGroupIndex){
          var that = this;
          if(that.tistype==1){//在职
            var onwork =  [{
                title: '个人简历',
                bgSelected:'widget://image/line1.png',
                bg: '#fff',
            }, {
                title: '入职信息',
                bg: '#fff',
                bgSelected:'widget://image/line1.png',
            },{
                title: '人事异动',
                bgSelected:'widget://image/line1.png',
                bg: '#fff',
            }, {
                title: '工作记录',
                bg: '#fff',
                bgSelected:'widget://image/line1.png',
            }]
            var whatwidth = {
                w: api.winWidth/4,
                h: 44
            }
          };
          if(that.tistype==2){//离职
            var onwork =  [{
                title: '个人简历',
                bgSelected:'widget://image/line1.png',
                bg: '#fff',
            }, {
                title: '入职信息',
                bg: '#fff',
                bgSelected:'widget://image/line1.png',
            },{
                title: '人事异动',
                bgSelected:'widget://image/line1.png',
                bg: '#fff',
            }, {
                title: '工作记录',
                bg: '#fff',
                bgSelected:'widget://image/line1.png',
            },{
                title: '办理离职',
                bgSelected:'widget://image/line1.png',
                bg: '#fff',
            }]
            var whatwidth = {
                w: api.winWidth/3.2,
                h: 44
            }
          }
          var NVNavigationBar = api.require('NVNavigationBar');
          NVNavigationBar.open({
                rect: {
                      x: 0,
                      y: iostoph,
                      w: api.winWidth,
                      h: 44
                },
                styles: {
                    orientation: 'horizontal',
                    bg: '#fff',
                    bgAlpha: 1,
                    font: {
                        size: 16,
                        sizeSelected: 18,
                        color: '#303030',
                        colorSelected: '#058142',
                        bold:true
                    },
                    itemSize: whatwidth
                },
                items:onwork,
                selectedIndex: frameGroupIndex,
                fixedOn: api.frameName,
                fixed: true,
                id: 'first',
                // itemTextPaddingLR:10
            }, function(ret, err) {
              // console.log(JSON.stringify(ret));
                if (ret.eventType == 'click') {
                    api.execScript({
                        name: that.thfromhtmlname,
                        // frameName: 'frmName',
                        script: 'fnsetFrameGroupIndex("openpersonrecordgroup","' + ret.index + '");'
                    });
                }
            });
        },
      }
    })
	}


	</script>
</body>
</html>
